home *** CD-ROM | disk | FTP | other *** search
/ IRIX Base Documentation 1998 November / IRIX 6.5.2 Base Documentation November 1998.img / usr / share / catman / u_man / cat3 / Tk / menubutton.z / menubutton
Text File  |  1998-10-30  |  15KB  |  265 lines

  1.  
  2.  
  3.  
  4. mmmmeeeennnnuuuubbbbuuuuttttttttoooonnnn((((3333TTTTkkkk))))                                                mmmmeeeennnnuuuubbbbuuuuttttttttoooonnnn((((3333TTTTkkkk))))
  5.  
  6.  
  7.  
  8. NNNNAAAAMMMMEEEE
  9.      menubutton - Create and manipulate menubutton widgets
  10.  
  11. SSSSYYYYNNNNOOOOPPPPSSSSIIIISSSS
  12.      mmmmeeeennnnuuuubbbbuuuuttttttttoooonnnn _p_a_t_h_N_a_m_e ?_o_p_t_i_o_n_s?
  13.  
  14. SSSSTTTTAAAANNNNDDDDAAAARRRRDDDD OOOOPPPPTTTTIIIIOOOONNNNSSSS
  15.      aaaaccccttttiiiivvvveeeeBBBBaaaacccckkkkggggrrrroooouuuunnnndddd  ccccuuuurrrrssssoooorrrr               hhhhiiiigggghhhhlllliiiigggghhhhttttTTTThhhhiiiicccckkkknnnneeeessssssss  ttttaaaakkkkeeeeFFFFooooccccuuuussss     |
  16.      aaaaccccttttiiiivvvveeeeFFFFoooorrrreeeeggggrrrroooouuuunnnndddd  ddddiiiissssaaaabbbblllleeeeddddFFFFoooorrrreeeeggggrrrroooouuuunnnndddd   iiiimmmmaaaaggggeeee               tttteeeexxxxtttt          |
  17.      aaaannnncccchhhhoooorrrr            ffffoooonnnntttt                 jjjjuuuussssttttiiiiffffyyyy             tttteeeexxxxttttVVVVaaaarrrriiiiaaaabbbblllleeee  |
  18.      bbbbaaaacccckkkkggggrrrroooouuuunnnndddd        ffffoooorrrreeeeggggrrrroooouuuunnnndddd           ppppaaaaddddXXXX                uuuunnnnddddeeeerrrrlllliiiinnnneeee     |
  19.      bbbbiiiittttmmmmaaaapppp            hhhhiiiigggghhhhlllliiiigggghhhhttttBBBBaaaacccckkkkggggrrrroooouuuunnnndddd  ppppaaaaddddYYYY                wwwwrrrraaaappppLLLLeeeennnnggggtttthhhh    |
  20.      bbbboooorrrrddddeeeerrrrWWWWiiiiddddtttthhhh       hhhhiiiigggghhhhlllliiiigggghhhhttttCCCCoooolllloooorrrr       rrrreeeelllliiiieeeeffff
  21.  
  22.      See the ``options'' manual entry for details on the standard options.
  23.  
  24. WWWWIIIIDDDDGGGGEEEETTTT----SSSSPPPPEEEECCCCIIIIFFFFIIIICCCC OOOOPPPPTTTTIIIIOOOONNNNSSSS
  25.      Name:           hhhheeeeiiiigggghhhhtttt
  26.      Class:          HHHHeeeeiiiigggghhhhtttt
  27.      Command-Line Switch:----hhhheeeeiiiigggghhhhtttt
  28.  
  29.           Specifies a desired height for the menubutton.  If an image or
  30.           bitmap is being displayed in the menubutton then the value is in
  31.           screen units (i.e. any of the forms acceptable to TTTTkkkk____GGGGeeeettttPPPPiiiixxxxeeeellllssss); for
  32.           text it is in lines of text.  If this option isn't specified, the
  33.           menubutton's desired height is computed from the size of the image
  34.           or bitmap or text being displayed in it.
  35.  
  36.      Name:           iiiinnnnddddiiiiccccaaaattttoooorrrrOOOOnnnn                                              |
  37.      Class:          IIIInnnnddddiiiiccccaaaattttoooorrrrOOOOnnnn                                              |
  38.      Command-Line Switch:----iiiinnnnddddiiiiccccaaaattttoooorrrroooonnnn                                         |
  39.  
  40.           The value must be a proper boolean value.  If it is true then a     |
  41.           small indicator rectangle will be displayed on the right side of the|
  42.           menubutton and the default menu bindings will treat this as an      |
  43.           option menubutton.  If false then no indicator will be displayed.
  44.  
  45.      Name:           mmmmeeeennnnuuuu
  46.      Class:          MMMMeeeennnnuuuuNNNNaaaammmmeeee
  47.      Command-Line Switch:----mmmmeeeennnnuuuu
  48.  
  49.           Specifies the path name of the menu associated with this menubutton.
  50.           The menu must be a child of the menubutton.
  51.  
  52.      Name:           ssssttttaaaatttteeee
  53.      Class:          SSSSttttaaaatttteeee
  54.      Command-Line Switch:----ssssttttaaaatttteeee
  55.  
  56.           Specifies one of three states for the menubutton:  nnnnoooorrrrmmmmaaaallll, aaaaccccttttiiiivvvveeee,
  57.           or ddddiiiissssaaaabbbblllleeeedddd.  In normal state the menubutton is displayed using the
  58.           ffffoooorrrreeeeggggrrrroooouuuunnnndddd and bbbbaaaacccckkkkggggrrrroooouuuunnnndddd options.  The active state is typically
  59.           used when the pointer is over the menubutton.  In active state the
  60.  
  61.  
  62.  
  63.                                                                         PPPPaaaaggggeeee 1111
  64.  
  65.  
  66.  
  67.  
  68.  
  69.  
  70. mmmmeeeennnnuuuubbbbuuuuttttttttoooonnnn((((3333TTTTkkkk))))                                                mmmmeeeennnnuuuubbbbuuuuttttttttoooonnnn((((3333TTTTkkkk))))
  71.  
  72.  
  73.  
  74.           menubutton is displayed using the aaaaccccttttiiiivvvveeeeFFFFoooorrrreeeeggggrrrroooouuuunnnndddd and
  75.           aaaaccccttttiiiivvvveeeeBBBBaaaacccckkkkggggrrrroooouuuunnnndddd options.  Disabled state means that the menubutton |
  76.           should be insensitive:  the default bindings will refuse to activate|
  77.           the widget and will ignore mouse button presses.  In this state the
  78.           ddddiiiissssaaaabbbblllleeeeddddFFFFoooorrrreeeeggggrrrroooouuuunnnndddd and bbbbaaaacccckkkkggggrrrroooouuuunnnndddd options determine how the button
  79.           is displayed.
  80.  
  81.      Name:           wwwwiiiiddddtttthhhh
  82.      Class:          WWWWiiiiddddtttthhhh
  83.      Command-Line Switch:----wwwwiiiiddddtttthhhh
  84.  
  85.           Specifies a desired width for the menubutton.  If an image or bitmap
  86.           is being displayed in the menubutton then the value is in screen
  87.           units (i.e. any of the forms acceptable to TTTTkkkk____GGGGeeeettttPPPPiiiixxxxeeeellllssss); for text
  88.           it is in characters.  If this option isn't specified, the
  89.           menubutton's desired width is computed from the size of the image or
  90.           bitmap or text being displayed in it.
  91.  
  92.  
  93. IIIINNNNTTTTRRRROOOODDDDUUUUCCCCTTTTIIIIOOOONNNN
  94.      The mmmmeeeennnnuuuubbbbuuuuttttttttoooonnnn command creates a new window (given by the _p_a_t_h_N_a_m_e
  95.      argument) and makes it into a menubutton widget.  Additional options,
  96.      described above, may be specified on the command line or in the option
  97.      database to configure aspects of the menubutton such as its colors, font,
  98.      text, and initial relief.  The mmmmeeeennnnuuuubbbbuuuuttttttttoooonnnn command returns its _p_a_t_h_N_a_m_e
  99.      argument.  At the time this command is invoked, there must not exist a
  100.      window named _p_a_t_h_N_a_m_e, but _p_a_t_h_N_a_m_e's parent must exist.
  101.  
  102.      A menubutton is a widget that displays a textual string, bitmap, or image|
  103.      and is associated with a menu widget.  If text is displayed, it must all |
  104.      be in a single font, but it can occupy multiple lines on the screen (if  |
  105.      it contains newlines or if wrapping occurs because of the wwwwrrrraaaappppLLLLeeeennnnggggtttthhhh     |
  106.      option) and one of the characters may optionally be underlined using the |
  107.      uuuunnnnddddeeeerrrrlllliiiinnnneeee option.  In normal usage, pressing mouse button 1 over the
  108.      menubutton causes the associated menu to be posted just underneath the
  109.      menubutton.  If the mouse is moved over the menu before releasing the
  110.      mouse button, the button release causes the underlying menu entry to be
  111.      invoked.  When the button is released, the menu is unposted.
  112.  
  113.      Menubuttons are typically organized into groups called menu bars that
  114.      allow scanning:  if the mouse button is pressed over one menubutton
  115.      (causing it to post its menu) and the mouse is moved over another
  116.      menubutton in the same menu bar without releasing the mouse button, then
  117.      the menu of the first menubutton is unposted and the menu of the new
  118.      menubutton is posted instead.
  119.  
  120.      There are several interactions between menubuttons and menus;  see the   |
  121.      mmmmeeeennnnuuuu manual entry for information on various menu configurations, such as|
  122.      pulldown menus and option menus.
  123.  
  124.  
  125.  
  126.  
  127.  
  128.  
  129.                                                                         PPPPaaaaggggeeee 2222
  130.  
  131.  
  132.  
  133.  
  134.  
  135.  
  136. mmmmeeeennnnuuuubbbbuuuuttttttttoooonnnn((((3333TTTTkkkk))))                                                mmmmeeeennnnuuuubbbbuuuuttttttttoooonnnn((((3333TTTTkkkk))))
  137.  
  138.  
  139.  
  140. WWWWIIIIDDDDGGGGEEEETTTT CCCCOOOOMMMMMMMMAAAANNNNDDDD
  141.      The mmmmeeeennnnuuuubbbbuuuuttttttttoooonnnn command creates a new Tcl command whose name is _p_a_t_h_N_a_m_e.
  142.      This command may be used to invoke various operations on the widget.  It
  143.      has the following general form:
  144.  
  145.           _p_a_t_h_N_a_m_e _o_p_t_i_o_n ?_a_r_g _a_r_g ...?
  146.  
  147.      _O_p_t_i_o_n and the _a_r_gs determine the exact behavior of the command.  The
  148.      following commands are possible for menubutton widgets:
  149.  
  150.      _p_a_t_h_N_a_m_e ccccggggeeeetttt _o_p_t_i_o_n
  151.           Returns the current value of the configuration option given by      |
  152.           _o_p_t_i_o_n.  _O_p_t_i_o_n may have any of the values accepted by the          |
  153.           mmmmeeeennnnuuuubbbbuuuuttttttttoooonnnn command.
  154.  
  155.      _p_a_t_h_N_a_m_e ccccoooonnnnffffiiiigggguuuurrrreeee ?_o_p_t_i_o_n? ?_v_a_l_u_e _o_p_t_i_o_n _v_a_l_u_e ...?
  156.           Query or modify the configuration options of the widget.  If no
  157.           _o_p_t_i_o_n is specified, returns a list describing all of the available
  158.           options for _p_a_t_h_N_a_m_e (see TTTTkkkk____CCCCoooonnnnffffiiiigggguuuurrrreeeeIIIInnnnffffoooo for information on the
  159.           format of this list).  If _o_p_t_i_o_n is specified with no _v_a_l_u_e, then
  160.           the command returns a list describing the one named option (this
  161.           list will be identical to the corresponding sublist of the value
  162.           returned if no _o_p_t_i_o_n is specified).  If one or more _o_p_t_i_o_n-_v_a_l_u_e
  163.           pairs are specified, then the command modifies the given widget
  164.           option(s) to have the given value(s);  in this case the command
  165.           returns an empty string.  _O_p_t_i_o_n may have any of the values accepted
  166.           by the mmmmeeeennnnuuuubbbbuuuuttttttttoooonnnn command.
  167.  
  168.  
  169. DDDDEEEEFFFFAAAAUUUULLLLTTTT BBBBIIIINNNNDDDDIIIINNNNGGGGSSSS
  170.      Tk automatically creates class bindings for menubuttons that give them   |
  171.      the following default behavior:
  172.  
  173.      [1]  A menubutton activates whenever the mouse passes over it and
  174.           deactivates whenever the mouse leaves it.
  175.  
  176.      [2]  Pressing mouse button 1 over a menubutton posts the menubutton:  its
  177.           relief changes to raised and its associated menu is posted under the
  178.           menubutton.  If the mouse is dragged down into the menu with the
  179.           button still down, and if the mouse button is then released over an
  180.           entry in the menu, the menubutton is unposted and the menu entry is
  181.           invoked.
  182.  
  183.      [3]  If button 1 is pressed over a menubutton and then released over that
  184.           menubutton, the menubutton stays posted: you can still move the
  185.           mouse over the menu and click button 1 on an entry to invoke it.
  186.           Once a menu entry has been invoked, the menubutton unposts itself.
  187.  
  188.      [4]  If button 1 is pressed over a menubutton and then dragged over some
  189.           other menubutton, the original menubutton unposts itself and the new
  190.           menubutton posts.
  191.  
  192.  
  193.  
  194.  
  195.                                                                         PPPPaaaaggggeeee 3333
  196.  
  197.  
  198.  
  199.  
  200.  
  201.  
  202. mmmmeeeennnnuuuubbbbuuuuttttttttoooonnnn((((3333TTTTkkkk))))                                                mmmmeeeennnnuuuubbbbuuuuttttttttoooonnnn((((3333TTTTkkkk))))
  203.  
  204.  
  205.  
  206.      [5]  If button 1 is pressed over a menubutton and released outside any
  207.           menubutton or menu, the menubutton unposts without invoking any menu
  208.           entry.
  209.  
  210.      [6]  When a menubutton is posted, its associated menu claims the input
  211.           focus to allow keyboard traversal of the menu and its submenus.  See
  212.           the mmmmeeeennnnuuuu manual entry for details on these bindings.
  213.  
  214.      [7]  If the uuuunnnnddddeeeerrrrlllliiiinnnneeee option has been specified for a menubutton then
  215.           keyboard traversal may be used to post the menubutton:  Alt+_x, where
  216.           _x is the underlined character (or its lower-case or upper-case
  217.           equivalent), may be typed in any window under the menubutton's
  218.           toplevel to post the menubutton.
  219.  
  220.      [8]  The F10 key may be typed in any window to post the first menubutton
  221.           under its toplevel window that isn't disabled.
  222.  
  223.      [9]  If a menubutton has the input focus, the space and return keys post
  224.           the menubutton.
  225.  
  226.      If the menubutton's state is ddddiiiissssaaaabbbblllleeeedddd then none of the above actions
  227.      occur:  the menubutton is completely non-responsive.
  228.  
  229.      The behavior of menubuttons can be changed by defining new bindings for
  230.      individual widgets or by redefining the class bindings.
  231.  
  232.  
  233. KKKKEEEEYYYYWWWWOOOORRRRDDDDSSSS
  234.      menubutton, widget
  235.  
  236.  
  237.  
  238.  
  239.  
  240.  
  241.  
  242.  
  243.  
  244.  
  245.  
  246.  
  247.  
  248.  
  249.  
  250.  
  251.  
  252.  
  253.  
  254.  
  255.  
  256.  
  257.  
  258.  
  259.  
  260.  
  261.                                                                         PPPPaaaaggggeeee 4444
  262.  
  263.  
  264.  
  265.